#ifndef IMAGEEDITWIDGET_H
#define IMAGEEDITWIDGET_H

#include <QWidget>
#include "imageeditinterface.h"
#include "imageedit_global.h"

namespace Ui {
class ImageEditWidget;
}

class IMAGEEDITPLUGINSHARED_EXPORT ImageEditWidget : public QWidget, public ImageEditInterface
{
    Q_OBJECT
    Q_PLUGIN_METADATA(IID ImageEditPlugin_iid)
    Q_INTERFACES(ImageEditInterface)
public:
    explicit ImageEditWidget(QWidget *parent = 0);
    ~ImageEditWidget();

    QObject *getObject() { return this; }
    void setFileFormat(DcmFileFormat *dff);
    void setEditorHook(EditorProc proc, void *userData) { m_proc = proc; m_userData = userData; }
    void setTransform(bool rl, bool rr, bool fh, bool fv);
    void getWindow(double &center, double &width) const;
    void setWindow(const double &center, const double &width);
    void getClipRect(QRect &rect) const;
    void setClipRect(const QRect &rect);

protected:
    void closeEvent(QCloseEvent *e);

private slots:
    void on_okBtn_clicked();
    void on_cancelBtn_clicked();

private:
    void init();

    Ui::ImageEditWidget *ui;

    EditorProc m_proc;
    void *m_userData;
};

#endif // IMAGEEDITWIDGET_H
